from aiogram_dialog import Dialog
from aiogram_dialog.widgets.kbd import Start

from poker_bot.tg_bot.dialogs.getters.users import user_accounts_getter
from poker_bot.tg_bot.dialogs.reusable_windows import get_list_window
from poker_bot.tg_bot.dialogs.widgets import LocaleText
from poker_bot.tg_bot.states import AddAccountSG, UserAccountsSG

from .handlers import select_account

accounts_list_dialog = Dialog(
    get_list_window(
        "accounts-list-msg",
        "{item.account_id}",
        "accounts",
        UserAccountsSG.accounts_list,
        user_accounts_getter,
        select_account,
        [
            Start(
                LocaleText("add-account-btn"),
                "add_account",
                AddAccountSG.enter_account_id,
            )
        ],
    ),
)
